package factorymethod.creator;

import factorymethod.product.Product;
import factorymethod.product.ProductAA;
import factorymethod.product.ProductAB;
import factorymethod.product.ProductAC;
import factorymethod.product.ProductAD;
import factorymethod.product.ProductTypeEnum;

/**
 * description:
 *
 * @author yuanmenglv on 2019/11/28
 */
public class CreatorA extends Creator {
    @Override
    Product createProduct(String type) {
        Product product = null;
        if ( ProductTypeEnum.PRODUCTA.getType().equals(type) ){
            product = new ProductAA();
        }else if ( ProductTypeEnum.PRODUCTB.getType().equals(type) ){
            product = new ProductAB();
        }else if ( ProductTypeEnum.PRODUCTC.getType().equals(type) ){
            product = new ProductAC();
        }else if ( ProductTypeEnum.PRODUCTD.getType().equals(type) ){
            product = new ProductAD();
        }
        return product;
    }

}
